//
//  DefaultSettings.m
//
//  Created by Jeremy Whitcher on 3/10/12.
//

#import "DefaultSettings.h"

@implementation DefaultSettings

@synthesize defaultLocation;
@synthesize defaultContact;
@synthesize defaultEmail;
@synthesize defaultPhone;
@synthesize defaultSharing;

#define DEFAULT_LOCATION_KEY "DefaultLocation"
#define DEFAULT_CONTACT_KEY  "DefaultContact"
#define DEFAULT_EMAIL_KEY    "DefaultEmail"
#define DEFAULT_PHONE_KEY    "DefaultPhone"
#define DEFAULT_SHARING_KEY  FALSE

-(void) encodeWithCoder: (NSCoder *) encoder
{
    [encoder encodeObject: defaultLocation forKey: @DEFAULT_LOCATION_KEY];
    [encoder encodeObject: defaultContact forKey: @DEFAULT_CONTACT_KEY];
    [encoder encodeObject: defaultEmail forKey: @DEFAULT_EMAIL_KEY];
    [encoder encodeObject: defaultPhone forKey: @DEFAULT_PHONE_KEY];
}

-(id) initWithCoder: (NSCoder *) decoder
{
    defaultLocation = [decoder decodeObjectForKey:@DEFAULT_LOCATION_KEY];
    defaultContact  = [decoder decodeObjectForKey:@DEFAULT_CONTACT_KEY];
    defaultEmail    = [decoder decodeObjectForKey:@DEFAULT_EMAIL_KEY];
    defaultPhone    = [decoder decodeObjectForKey:@DEFAULT_PHONE_KEY];
    //defaultSharing  = [decoder decodeBoolForKey:DEFAULT_SHARING_KEY];
    
    return self;
}

@end
